<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<div>
    <div>
        <ul class="order-info-list">
            <li>
                <p>订单编号</p>
                <b class="blue">
                    <a href="javascript:;" class="dggui-link"  onclick="openBusinessDetail('${orderDto.orderNo}','${orderDto.id}')" >${orderDto.orderNo}</a>
                </b>
            </li>
            <li>
                <p>下单时间</p>
                <b><fmt:formatDate value="${orderDto.placeOrderTime}" pattern="yyyy-MM-dd hh:mm:ss"/></b>
            </li>
            <li>
                <p>签单商务</p>
                <b>${orderDto.businessUserName}</b>
            </li>
            <li>
                <p>合同编号</p>
                <b>${orderDto.contractNo}</b>
            </li>
            <li>
                <p>订单金额</p>
                <b>${orderDto.amount}</b>
            </li>
            <li>
                <p>认款金额</p>
                <b>${orderDto.endAmount}</b>
            </li>
            <li>
                <p>付款方式</p>
                <b>${orderDto.paymentMethod}</b>
            </li>
        </ul>
        <h4>生产单详情</h4>
        <!--无数据时将它显示出来-->
        <c:if test="${empty productOrders}">
            <p>暂无数据 </p>
        </c:if>
        <c:if test="${!empty productOrders}">
            <c:forEach items="${productOrders}" var="key">
                <ul class="production-detail-list">
                    <li>生产单编号：<a href="javascript:;"  class="dggui-link" onclick="openOrderInfoDetail('${key.scProductOrderNo}','${key.id}')">${key.scProductOrderNo}</a></li>
                    <li>接单时间：<fmt:formatDate value="${key.receiveOrderDate}" pattern="yyyy-MM-dd"/></li>
                    <li>放款时间：<fmt:formatDate value="${key.loanTime}" pattern="yyyy-MM-dd"/></li>
                    <li>还款时间：<span class="loan_way_and_date_txt" data-wayOfLoan="${key.wayOfLoan}" data-dateOfLoan="${key.dateOfLoan}"></span></li>
                    <li>还款到期日期：<fmt:formatDate value="${key.repaymentDate}" type="both" pattern="yyyy-MM-dd"/></li>
                    <li>业务类型：${key.businessTypeName}</li>
                    <li>每期还款金额：${key.installmentRepayment}</li>
                    <li>流程人员：${key.flowUserName}</li>
                    <li>产品：${key.productName}</li>
                    <li>渠道：${key.channelName}</li>
                    <li>需求金额：${key.loanAmount}</li>
                    <li>放款金额：${key.loanMoney}</li>
                </ul>
            </c:forEach>
        </c:if>
    </div>
</div>
<script type="text/javascript">
    $(function (){
        $.each($(".loan_way_and_date_txt"),function (o,v) {
            var wayOfLoan = $(this).attr("data-wayOfLoan");
            var dateOfLoan = $(this).attr("data-dateOfLoan");
            $(this).text(joinLoanWayAndTimeTxt(wayOfLoan,dateOfLoan));
        });
    });
</script>